package factory_model;


public class BuyBasketball {
	public static void main(String[] args) {
		Basketball bas=FactoryModel2.getBasketball(FactoryModel2.x1);
		System.out.println(bas.toString());
	}

}
class FactoryModel2 {
	final static  int x1=1;
	final static int x2=2;
	final static int x3=3;
	final static int x4=4;
	static Basketball getBasketball(int type){
		switch(type){
		case x1:return new Jordan();
		case x2:return new Afus();
		case x3:return new Nike();
		case x4:return new Adidas();
		default:return null;
		
		}
	}

}
interface Basketball{
	String toString();
}
class Jordan implements Basketball{
	@Override
	public String toString() {
		return "Jordan [name=" + name + ", volume=" + volume + ", strength="
				+ strength + "]";
	}
	String name;
	String volume;
	int strength;
	
}
class Afus implements Basketball{
	@Override
	public String toString() {
		return "Jordan [name=" + name + ", volume=" + volume + ", strength="
				+ strength + "]";
	}
	String name;
	String volume;
	int strength;
	
}
class Nike implements Basketball{
	@Override
	public String toString() {
		return "Jordan [name=" + name + ", volume=" + volume + ", strength="
				+ strength + "]";
	}
	String name;
	String volume;
	int strength;
	
}
class Adidas implements Basketball{
	@Override
	public String toString() {
		return "Jordan [name=" + name + ", volume=" + volume + ", strength="
				+ strength + "]";
	}
	String name;
	String volume;
	int strength;
	
}